import request from '@/utils/request'

// 创建设备
export function createEquipmentInfo(data) {
  return request({
    url: '/biz/equipment-info/create',
    method: 'post',
    data: data
  })
}

// 更新设备
export function updateEquipmentInfo(data) {
  return request({
    url: '/biz/equipment-info/update',
    method: 'put',
    data: data
  })
}

// 删除设备
export function deleteEquipmentInfo(id) {
  return request({
    url: '/biz/equipment-info/delete?id=' + id,
    method: 'delete'
  })
}

// 获得设备
export function getEquipmentInfo(id) {
  return request({
    url: '/biz/equipment-info/get?id=' + id,
    method: 'get'
  })
}

// 获得设备分页
export function getEquipmentInfoPage(query) {
  return request({
    url: '/biz/equipment-info/page',
    method: 'get',
    params: query
  })
}

// 导出设备 Excel
export function exportEquipmentInfoExcel(query) {
  return request({
    url: '/biz/equipment-info/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

// 下载设备设施导入模板
export function downloadTemplate() {
  return request({
    url: '/biz/equipment-info/downEquipmentTemplate',
    method: 'post',
    responseType: 'blob'
  })
}
